import math

def jis(base,beishu,kui_total):
    kui = []    # 记录每次累计亏损
    bei = []    # 记录每次倍数
    li = []     # 记录每次利润
    gou = []
    # 第一次购买
    kui01 = base*1
    kui.append(kui01)
    bei.append(1)
    li.append(base*beishu-kui01)
    # 计算倍数,由累计亏损总金额来控制
    temp = bei[-1]
    while kui[-1] < kui_total:
        lirun = base*(beishu-1)*temp
        # 累计亏损/中奖利润
        m = kui[-1]/lirun
        n = math.ceil(m)
        g = lirun-kui[-1]
        if n > 0 and g > 0:
            bei.append(temp)
            kui.append(kui[-1]+temp*base)
            li.append(g)
            gou.append(base*temp)
        else:
            temp += 1
    print(len(bei),bei)
    print(kui)
    print(li)
    print(gou)

    for i in bei:
        print(i)

if __name__ == '__main__':
    jis(2,30,10000)